package com.demo.consumer.action;

import com.demo.domain.User;
import com.demo.service.UserService;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

@Component
public class UserServiceAction {

    @Reference(
            interfaceClass = UserService.class,
            version = "1.0.0",
            timeout = 10000,
            methods = {@Method(name = "queryUsers", timeout = 30000, retries = 3)}
    )
    private UserService userService;

    public void queryUsersRef(){
        User user = userService.queryUsers();
        System.out.println(user);
    }

}
